#pragma once
#pragma warning( disable: 4251 ) 
//WGLENGINE_DLL
#ifdef WGLENGINE_DLL
#define WGLENGINE_EXPORT __declspec(dllexport)
#else
#define WGLENGINE_EXPORT __declspec(dllimport)
#endif

#include <map>
#include <vector>
#include <string>

#include "GL\glew.h"

class WGLENGINE_EXPORT Texture
{
protected:

	std::string GetBasePath(const std::string& path);
	std::string GetFileName(const std::string& path);
	
	GLuint textureID;

public:
	Texture();
	Texture(std::string fullFilePath);
	~Texture();
	
	virtual bool LoadImage();

	GLuint GetTextureID()
	{
		return textureID;
	}

	void SetTextureID(GLuint id);
	void SetFileName(std::string filename)
	{
		this->fileName = filename;
	}
	void SetPath(std::string path)
	{
		this->path = path;
	}


	static std::map<std::string, std::shared_ptr<Texture>> textureMap;
	static int GetNumberOfTextures()
	{
		return (int) textureMap.size();
	}
	
	virtual void Bind()
	{
		glBindTexture(GL_TEXTURE_2D, textureID); // Binding of texture name 
	}

	virtual void Unbind()
	{
		glBindTexture(GL_TEXTURE_2D, 0); // Binding of texture name 
	}

private:
	std::string path;
	std::string fileName;

};